<div class="page">
    <h2 class="title-historico">Meus Dados Cadastrais</h2>
    <hr/>


    <?php
    add_js('scripts/frontend/conta_pessoa_juridica', 'footer', 20);
    add_js('plugins/frontend/jquery.mask', 'footer', 8);
    ?>
    <div class="container">
        <div class="row">

            <!-- COLUMN RIGHT -->
            <div class="col-xs-10">
                <!-- DIV JURIDICO -->
                <div class="box-pessoa-juridica">

                    <?php
                    if ($erros = validation_errors()) {
                        echo '<div class="display-box-message alert alert-danger">' . $erros . '</div>';
                    }

                    if ($success = $this->session->flashdata('success_change')) {
                        echo '<div class="display-box-message alert alert-success">' . $success . '</div>';
                    }
                    ?>
                    <?php
                    echo form_open(BASE_URL_USER . '/save/' . $user->USER_ID, 'id="formPessoaJuridica"');
                    echo form_hidden('tipo', 'J');
                    ?>
                    <div class="box-form-cadastro">

                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('Razão Social :', 'razao-social', array('class' => 'required')); ?>
                                </div>
                                <div class="col-xs-9">
                                    <?php echo form_input('razao', set_value('razao', $user->NOME), 'class="form-control" validation="required"'); ?>
                                </div>
                            </div> 
                        </div>

                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('CNPJ :', 'cnpj', array('class' => 'required')); ?>	
                                </div>
                                <div class="col-xs-4">

                                    <?php echo form_input('cnpj', set_value('cnpj', $user->CPF_CNPJ), 'class="form-control" validation="required|cnpj"'); ?>
                                </div>

                                <div class="col-xs-1">
                                    <?php echo form_label('IE :'); ?>	
                                </div>
                                <div class="col-xs-4">
                                    <?php echo form_input('ie', set_value('ie', $user->RG_IE), 'class="form-control" '); ?>	
                                </div>

                            </div> 
                        </div>

                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('Representante', 'representante', array('class' => 'required')); ?>	
                                </div>
                                <div class="col-xs-4">
                                    <?php echo form_input('contato', set_value('contato', $user->CONTATO), 'class="form-control" validation="required"'); ?>
                                </div>

                                <div class="col-xs-1">
                                    <?php echo form_label('CPF'); ?>	
                                </div>
                                <div class="col-xs-4">
                                    <?php echo form_input('cpf_representante', set_value('cpf_representante', $user->CPF_CONTATO), 'class="form-control" '); ?>

                                </div>

                            </div> 
                        </div>



                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('Endereço :', 'endereco', array('class' => 'required')); ?>
                                </div>
                                <div class="col-xs-6">
                                    <?php echo form_input('endereco', set_value('endereco', $user->LOGRADOURO), 'class="form-control" validation="required"'); ?>
                                </div>
                                <div class="col-xs-1">
                                    <?php echo form_label('N. :', 'numero', array('class' => 'required')); ?>
                                </div>
                                <div class="col-xs-2">
                                    <?php echo form_input('numero', set_value('numero', $user->NUMERO), 'class="form-control" validation="required"'); ?>
                                </div>
                            </div> 
                        </div>
                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('Bairro :', 'bairro', array('class' => 'required')); ?>
                                </div>
                                <div class="col-xs-3">
                                    <?php echo form_input('bairro', set_value('bairro', $user->BAIRRO), 'class="form-control" validation="required"'); ?>
                                </div>
                                <div class="col-xs-1">
                                    <?php echo form_label('Cidade:', 'cidade', array('class' => 'required')); ?>
                                </div>
                                <div class="col-xs-3">
                                    <?php echo form_input('cidade', set_value('cidade', $user->CIDADE), 'class="form-control" validation="required"'); ?>
                                </div>
                                <div class="col-xs-1">
                                    <?php echo form_label('Estado:', 'estado', array('class' => 'required')); ?>
                                </div>
                                <div class="col-xs-1">
                                    <?php echo form_input('uf', set_value('uf', $user->UF), 'class="form-control" validation="required"'); ?>
                                </div>
                            </div> 
                        </div>
                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <label>Telefone : </label> 	
                                </div>
                                <div class="col-xs-1">
                                    <?php echo form_input('telefone-ddd', set_value('telefone-ddd', substr($user->TELEFONE, 0, 2)), 'class="form-control" validation="required"'); ?>

                                </div>
                                <div class="col-xs-3">
                                    <?php echo form_input('telefone-numero', set_value('telefone-numero', substr($user->TELEFONE, 2)), 'class="form-control" validation="required"'); ?>

                                </div>

                                <div class="col-xs-1">
                                    <label>celular: </label> 	
                                </div>
                                <div class="col-xs-1">
                                    <?php echo form_input('celular-ddd', set_value('celular-ddd', substr($user->CELULAR, 0, 2)), 'class="form-control" '); ?>

                                </div>
                                <div class="col-xs-3">
                                    <?php echo form_input('celular-numero', set_value('celular-numero', substr($user->CELULAR, 2)), 'class="form-control" '); ?>

                                </div>

                            </div> 
                        </div>

                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('Email:', 'email', array('class' => 'required')); ?>	
                                </div>
                                <div class="col-xs-9">
                                    <?php echo form_input('email', set_value('email', $user->EMAIL), 'class="form-control" validation="required|email"'); ?>	
                                </div>
                            </div> 
                        </div>

                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('Email Alternativo:', 'email-alt', array('class' => 'required')); ?>	
                                </div>
                                <div class="col-xs-9">
                                    <?php echo form_input('email-alternativo', set_value('email-alternativo', $user->EMAIL_ALTERNATIVO), 'class="form-control" validation="required|email"'); ?>	
                                </div>
                            </div> 
                        </div>


                        <div class="row">
                            <div class="form-group">
                                <div class="col-xs-2">
                                    <?php echo form_label('Apelido:', 'apelido', array('class' => 'required')); ?>	
                                </div>
                                <div class="col-xs-3">
                                    <?php echo form_input('login', set_value('login', $user->LOGIN), 'class="form-control" readonly maxlength="12" validation="required"'); ?>	
                                </div>

                            </div> 
                        </div>
                        <a href="#altPassword" role="passwordChange" class="btn btn-sm btn-password-alter">Alterar Senha</a><br/>
                        <hr/>
                        <div class="row">
                            <div class="form-group box-display-input-passwords">

                            </div>
                        </div>



                        <div class="clear"></div>
                        <div class="row">
                            <div class="col-xs-12 box-btns-center">
                                <div class="form-group">
                                    <input type="submit" name="" value="Salvar Alterações" class="btn btn-primary"/>

                                </div>
                            </div>
                        </div>

                    </div>
                    </form>



                </div>

            </div>
        </div>
    </div>
</div>